package com.shs.com.utils;


import com.shs.com.entity.InfoMsg;
import com.shs.com.entity.ResponseBody;

public class AssembleResponseMsg {
    // 返回成功
    public <T> ResponseBody success(T data){
        ResponseBody responseBody = new ResponseBody();
        responseBody.setData(data);
        InfoMsg infoMsg = new InfoMsg();
        responseBody.setInfo(infoMsg);
        return responseBody;
    }
    //返回失败
    public <T> ResponseBody failure(int status,String code,String msg){
        ResponseBody responseBody = new ResponseBody();
        responseBody.setStatus(status);
        InfoMsg infoMsg = new InfoMsg();
        infoMsg.setCode(code);
        infoMsg.setMessage(msg);
        responseBody.setInfo(infoMsg);
        return responseBody;
    }
}
